/*
 * XML Type:  EmailRequestMessageSetV1
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.EmailRequestMessageSetV1
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML EmailRequestMessageSetV1(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class EmailRequestMessageSetV1Impl extends net.ofx.types.x2003.x04.impl.AbstractRequestMessageSetImpl implements net.ofx.types.x2003.x04.EmailRequestMessageSetV1
{
    
    public EmailRequestMessageSetV1Impl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName MAILTRNRQ$0 = 
        new javax.xml.namespace.QName("", "MAILTRNRQ");
    private static final javax.xml.namespace.QName MAILSYNCRQ$2 = 
        new javax.xml.namespace.QName("", "MAILSYNCRQ");
    private static final javax.xml.namespace.QName GETMIMETRNRQ$4 = 
        new javax.xml.namespace.QName("", "GETMIMETRNRQ");
    
    
    /**
     * Gets array of all "MAILTRNRQ" elements
     */
    public net.ofx.types.x2003.x04.MailTransactionRequest[] getMAILTRNRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(MAILTRNRQ$0, targetList);
            net.ofx.types.x2003.x04.MailTransactionRequest[] result = new net.ofx.types.x2003.x04.MailTransactionRequest[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "MAILTRNRQ" element
     */
    public net.ofx.types.x2003.x04.MailTransactionRequest getMAILTRNRQArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionRequest)get_store().find_element_user(MAILTRNRQ$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "MAILTRNRQ" element
     */
    public int sizeOfMAILTRNRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAILTRNRQ$0);
        }
    }
    
    /**
     * Sets array of all "MAILTRNRQ" element
     */
    public void setMAILTRNRQArray(net.ofx.types.x2003.x04.MailTransactionRequest[] mailtrnrqArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(mailtrnrqArray, MAILTRNRQ$0);
        }
    }
    
    /**
     * Sets ith "MAILTRNRQ" element
     */
    public void setMAILTRNRQArray(int i, net.ofx.types.x2003.x04.MailTransactionRequest mailtrnrq)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionRequest)get_store().find_element_user(MAILTRNRQ$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(mailtrnrq);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "MAILTRNRQ" element
     */
    public net.ofx.types.x2003.x04.MailTransactionRequest insertNewMAILTRNRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionRequest)get_store().insert_element_user(MAILTRNRQ$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "MAILTRNRQ" element
     */
    public net.ofx.types.x2003.x04.MailTransactionRequest addNewMAILTRNRQ()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionRequest)get_store().add_element_user(MAILTRNRQ$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "MAILTRNRQ" element
     */
    public void removeMAILTRNRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAILTRNRQ$0, i);
        }
    }
    
    /**
     * Gets array of all "MAILSYNCRQ" elements
     */
    public net.ofx.types.x2003.x04.MailSyncRequest[] getMAILSYNCRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(MAILSYNCRQ$2, targetList);
            net.ofx.types.x2003.x04.MailSyncRequest[] result = new net.ofx.types.x2003.x04.MailSyncRequest[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "MAILSYNCRQ" element
     */
    public net.ofx.types.x2003.x04.MailSyncRequest getMAILSYNCRQArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailSyncRequest target = null;
            target = (net.ofx.types.x2003.x04.MailSyncRequest)get_store().find_element_user(MAILSYNCRQ$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "MAILSYNCRQ" element
     */
    public int sizeOfMAILSYNCRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAILSYNCRQ$2);
        }
    }
    
    /**
     * Sets array of all "MAILSYNCRQ" element
     */
    public void setMAILSYNCRQArray(net.ofx.types.x2003.x04.MailSyncRequest[] mailsyncrqArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(mailsyncrqArray, MAILSYNCRQ$2);
        }
    }
    
    /**
     * Sets ith "MAILSYNCRQ" element
     */
    public void setMAILSYNCRQArray(int i, net.ofx.types.x2003.x04.MailSyncRequest mailsyncrq)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailSyncRequest target = null;
            target = (net.ofx.types.x2003.x04.MailSyncRequest)get_store().find_element_user(MAILSYNCRQ$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(mailsyncrq);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "MAILSYNCRQ" element
     */
    public net.ofx.types.x2003.x04.MailSyncRequest insertNewMAILSYNCRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailSyncRequest target = null;
            target = (net.ofx.types.x2003.x04.MailSyncRequest)get_store().insert_element_user(MAILSYNCRQ$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "MAILSYNCRQ" element
     */
    public net.ofx.types.x2003.x04.MailSyncRequest addNewMAILSYNCRQ()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailSyncRequest target = null;
            target = (net.ofx.types.x2003.x04.MailSyncRequest)get_store().add_element_user(MAILSYNCRQ$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "MAILSYNCRQ" element
     */
    public void removeMAILSYNCRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAILSYNCRQ$2, i);
        }
    }
    
    /**
     * Gets array of all "GETMIMETRNRQ" elements
     */
    public net.ofx.types.x2003.x04.GetMimeTransactionRequest[] getGETMIMETRNRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(GETMIMETRNRQ$4, targetList);
            net.ofx.types.x2003.x04.GetMimeTransactionRequest[] result = new net.ofx.types.x2003.x04.GetMimeTransactionRequest[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "GETMIMETRNRQ" element
     */
    public net.ofx.types.x2003.x04.GetMimeTransactionRequest getGETMIMETRNRQArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GetMimeTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.GetMimeTransactionRequest)get_store().find_element_user(GETMIMETRNRQ$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "GETMIMETRNRQ" element
     */
    public int sizeOfGETMIMETRNRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(GETMIMETRNRQ$4);
        }
    }
    
    /**
     * Sets array of all "GETMIMETRNRQ" element
     */
    public void setGETMIMETRNRQArray(net.ofx.types.x2003.x04.GetMimeTransactionRequest[] getmimetrnrqArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(getmimetrnrqArray, GETMIMETRNRQ$4);
        }
    }
    
    /**
     * Sets ith "GETMIMETRNRQ" element
     */
    public void setGETMIMETRNRQArray(int i, net.ofx.types.x2003.x04.GetMimeTransactionRequest getmimetrnrq)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GetMimeTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.GetMimeTransactionRequest)get_store().find_element_user(GETMIMETRNRQ$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(getmimetrnrq);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "GETMIMETRNRQ" element
     */
    public net.ofx.types.x2003.x04.GetMimeTransactionRequest insertNewGETMIMETRNRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GetMimeTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.GetMimeTransactionRequest)get_store().insert_element_user(GETMIMETRNRQ$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "GETMIMETRNRQ" element
     */
    public net.ofx.types.x2003.x04.GetMimeTransactionRequest addNewGETMIMETRNRQ()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.GetMimeTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.GetMimeTransactionRequest)get_store().add_element_user(GETMIMETRNRQ$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "GETMIMETRNRQ" element
     */
    public void removeGETMIMETRNRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(GETMIMETRNRQ$4, i);
        }
    }
}
